// pages/gerenzhongxin/gerrenzhongxin.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    openid:'',
    user:{

    }
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.setData({
      openid:wx.getStorageSync('openid')
    })
    wx.request({
      url: 'http://localhost:80/UserQuery/select',
      method:"POST",
      data:{
        openid:this.data.openid
      },
      header:{
        'content-type': 'application/x-www-form-urlencoded'
    },
    success:res=>{
      console.log(res.data.data)
      this.setData({
        user:res.data.data
      })
      console.log(this.data.user)
    }
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  },
  // 页面跳转
  wodechuzu:function(){
    wx.navigateTo({
      url: '/pages/wodechuzu/wodechuzu?admin='+this.data.user.adminname,
    })
  },
  chuzu:function(){
    wx.navigateTo({
      url: '/pages/chuzuwuping/chuzuwuping',
    })
  },
  xiaoxi:function(){
    wx.navigateTo({
      url: '/pages/wodexiaoxi/wodexiaoxi',
    })
  },
  gerenxinxi:function(){
    wx.navigateTo({
      url: '/pages/gerenxinxi/gerenxinxi?a='+JSON.stringify(this.data.user)
    })
  },
  sezhi:function(){
    wx.navigateTo({
      url: '/pages/sezhi/sezhi',
    })
  },
  yuding:function(){
    wx.navigateTo({
      url: '/pages/yuding/yuding',
    })
  },
  yijie:function(){
    wx.navigateTo({
      url: '/pages/yijie/yijie',
    })
  },
  yuqi:function(){
    wx.navigateTo({
      url: '/pages/yuqi/yuqi',
    })
  },
  guihaun:function(){
    wx.navigateTo({
      url: '/pages/guihuan/guihuan',
    })
  },
  daipingjia:function(){
    wx.navigateTo({
      url: '/pages/daipingjia/daipingjia',
    })
  },
  vip:function(){
    wx.navigateTo({
      url: '/pages/pingjia/pingjia',
    })
  },
  dizi:function(){
    console.log(this.data.user)
    wx.navigateTo({
      url: '/pages/gerenxinxi/gerenxinxi?a='+JSON.stringify(this.data.user)
    })
    
  },
  alldingdan:function(){
    wx.navigateTo({
      url: '/pages/alldingdan/alldingdan',
    })
  }
})